Repository navigation
Revised addition operator reference - #8539
Merged
rpetrusha merged 2 commits intoOct 23, 2018
Merged
Conversation
Contributor
Author
|
As snippets PR is merged, let's close/reopen. |
Contributor
|
Build warnings show that merge of examples wasn't recognized. Closing and reopening to begin new build. |
rpetrusha
suggested changes
Oct 22, 2018
|
|
||
| ## Example | ||
| [!code-csharp[csRefOperators#35](../../../csharp/language-reference/operators/codesnippet/CSharp/addition-assignment-operator_1.cs)] | ||
| For numeric types, the [addition operator](addition-operator.md) `+` computes the sum of its operands. If one or both operands of type [string](../keywords/string.md), it concatenates the string representations of its operands. For delegate types, the `+` operator returns a new delegate instance that is combination of its operands. |
|
|
||
| The `+` operator is supported in two forms: a unary plus operator or a binary addition operator. | ||
|
|
||
| User-defined types can [overload](../keywords/operator.md) either of unary or binary `+` operators. When a binary `+` operator is overloaded, the [addition assignment operator](addition-assignment-operator.md) `+=` is also implicitly overloaded. |
Contributor
There was a problem hiding this comment.
either of unary or binary --> the unary and binary
|
|
||
| ## Unary plus operator | ||
|
|
||
| Unary `+` operator returns the value of its operand. It's supported by all numeric types. |
| - the absolute value of `z` is the value produced by `|x| - n * |y|` where `n` is the largest possible integer that is less than or equal to `|x| / |y|` and `|x|` and `|y|` are the absolute values of `x` and `y`, respectively. | ||
|
|
||
| For information about behavior of the `%` operator in case of non-finite operands, see the [Remainder operator](~/_csharplang/spec/expressions.md#remainder-operator) section of the [C# language specification](/dotnet/csharp/language-reference/language-specification/index). | ||
| For information about behavior of the `%` operator in case of non-finite operands, see the [Remainder operator](~/_csharplang/spec/expressions.md#remainder-operator) section of the [C# language specification](../language-specification/index.md). |
Contributor
There was a problem hiding this comment.
unrelated to your PR:
- behavior --> the behavior
- in case of --> with
Contributor
Author
|
@rpetrusha thanks for review; I've addressed your feedback. |
rpetrusha
approved these changes
Oct 23, 2018
Contributor
|
Thanks, @pkulikov, for the additional changes. I'll merge your PR now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revised addition operators (
+and+=) docs:+topic in sections